package com.wn.consumer.consumer2;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.naming.Name;
import java.awt.peer.LightweightPeer;

/**
 * @author yellow Docter
 * @date 2022 -08-31
 * @desc
 */
@Component
@Slf4j
public class SeatConsumer {

    /**
     * 创建队列
     * 创建交换机
     * 进行绑定
     *
     * @param msg
     */
    @RabbitListener(
            bindings = @QueueBinding(
                    value=@Queue("queue-fanout-seat"),
                    exchange = @Exchange(
                            name ="exchange-fanout",
                            type = ExchangeTypes.FANOUT
                    )
            )
    )
    public void seatConsumer(String msg){

      log.info("座位 进行了消费消息:{}",msg);

    }

}
